/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package SolvedProblems;

import java.util.Scanner;
import java.util.StringTokenizer;

/**
 *
 * @author Power User
 */
public class HorrorClash {

    public static void main(String args[]) {
        //File f = new File("input.txt");
        
        try {
            //Scanner scan = new Scanner(f);
            Scanner scan = new Scanner(System.in);
            int testCase  = scan.nextInt();
            scan.nextLine();
            for(int i = 0; i < testCase; i++){
                int max = -1000;
                String scaryCreatures = scan.nextLine();
                StringTokenizer strtok = new StringTokenizer(scaryCreatures);
                while(strtok.hasMoreTokens()){
                    int temp = Integer.parseInt(strtok.nextToken());
                    if(temp > max){
                        max = temp;
                    }
                }//end while
                System.out.println("Case "+ (i+1) + ": "+ max);
            }//end for
        } catch (Exception ex) {
        }//end try catch
    }//end main
}
